package com.example.fu3.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.MongoId;


import javax.validation.constraints.NotEmpty;
import java.io.Serializable;

@Data
@TableName("users")
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "用户登录入参")
@Document
public class User implements Serializable {

  public final String serializableUID="12324234354";

  @MongoId
  @TableId("user_id")
  private String id;

  @NotEmpty(message = "用户名不能为空")
  @TableField("user_name")
  @ApiModelProperty(value = "用户名")
  private String name;

  @NotEmpty(message = "密码不能为空")
  @ApiModelProperty(value = "用户密码")
  @NotEmpty()
  private String password;

}
